﻿CREATE TABLE [dbo].[Goc] (
    [Id]                 INT           IDENTITY (1, 1) NOT NULL,
    [GocAttribute]       VARCHAR (20)  NOT NULL,
    [LongDescription]    VARCHAR (250) NOT NULL,
    [Status]             CHAR (1)      NOT NULL,
    [UpdatedDate]        DATE          NULL,
    [SidId]              INT           NOT NULL,
    [LocalCostCode]      VARCHAR (10)  NOT NULL,
    [Manager]            VARCHAR (7)   NOT NULL,
    [FrsBuId]            INT           NOT NULL,
    [FrsOuId]            INT           NOT NULL,
    [FunctionId]         INT           NOT NULL,
    [LegalVehicleId]     INT           NOT NULL,
    [ManagedSegmentId]   INT           NOT NULL,
    [CountryId]          INT           NOT NULL,
    [ExpenseCode]        VARCHAR (20)  NULL,
    [CorpCode]           VARCHAR (20)  NULL,
    [ReferenceDate]      DATE          NOT NULL,
    [LastUpdate]         DATETIME      DEFAULT (getdate()) NOT NULL,
    [Corinth]            BIT           DEFAULT ((0)) NOT NULL,
    [OUC]                VARCHAR (10)  NULL,
    [Project]            VARCHAR (100) NULL,
    [ManagedGeographyId] INT           NOT NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF),
    FOREIGN KEY ([SidId]) REFERENCES [dbo].[Sid] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([FrsBuId]) REFERENCES [dbo].[FrsBu] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([FrsOuId]) REFERENCES [dbo].[FrsOu] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([FunctionId]) REFERENCES [dbo].[Function] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([LegalVehicleId]) REFERENCES [dbo].[LegalVehicle] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([ManagedSegmentId]) REFERENCES [dbo].[ManagedSegment] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([CountryId]) REFERENCES [dbo].[Country] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([ManagedGeographyId]) REFERENCES [dbo].[ManagedGeography] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION
);







